package com.cpecc.manager.wuzi;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cpecc.dao.wuzi.HuanHuoDao;
import com.cpecc.model.system.User;
import com.cpecc.model.wuzi.HuanHuo;
import com.cpecc.model.wuzi.ShenQing;
import com.cpecc.model.wuzi.WeiXiu;

@Service
@Transactional
public class HuanHuoManager {

	@Autowired
	private HuanHuoDao huanHuoDao;
	
	public void save(HuanHuo huanHuo){
		huanHuoDao.save(huanHuo);
	}
	
	public HuanHuo get(String id){
		return huanHuoDao.get(id);
	}
	
	public boolean cover(HuanHuo huanHuo){
		return huanHuoDao.cover(huanHuo);
	}
	
	public List<HuanHuo> getAllHuanHuoSQ(int lx){
		return huanHuoDao.getAllHuanHuoSQ(lx);
	}
	
	public List<HuanHuo> getAllHuanHuoSQ2CMR(int lx, User user){
		return huanHuoDao.getAllHuanHuoSQ2CMR(lx, user);
	}
	
	public HuanHuo getByShenQing(ShenQing shenQing){
		return huanHuoDao.getByShenQing(shenQing);
	}
	
	public HuanHuo getByWeiXiu(WeiXiu weiXiu){
		return huanHuoDao.getByWeiXiu(weiXiu);
	}
	
	public boolean hasWuZi(String wuZiId){
		return huanHuoDao.hasWuZi(wuZiId);
	}
	
	public boolean hasLiuCheng(User user){
		return huanHuoDao.hasLiuCheng(user);
	}
	
	public List<HuanHuo> activeHuanHuo(){
		return huanHuoDao.activeHuanHuo();
	}
}
